<html>
<head><meta charset="utf-8"><title>VarDebugInfo using constants instead of locals · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html">VarDebugInfo using constants instead of locals</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="187620166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187620166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187620166">(Feb 07 2020 at 07:58)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> hey, do you think it would be cheap to check in the constant folder if a local always has a constant value whenever initialized?</p>



<a name="187620182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187620182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187620182">(Feb 07 2020 at 07:59)</a>:</h4>
<p>I guess it could be its own pass post-constant-folding, that checks for one initialization and no mutation</p>



<a name="187620277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187620277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187620277">(Feb 07 2020 at 08:01)</a>:</h4>
<p>I want to have <code>debug x =&gt; _123;</code> replaced with e.g. <code>debug x =&gt; const 42usize;</code> wherever possible</p>



<a name="187620404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187620404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187620404">(Feb 07 2020 at 08:03)</a>:</h4>
<p>the other thing we could do is <code>debug a =&gt; &amp;b.c;</code> (value of debug var a is always the address of a place with no runtime indexing or derefs)</p>



<a name="187620479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187620479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187620479">(Feb 07 2020 at 08:05)</a>:</h4>
<p>the latter wouldn't count as a borrow because only the debugger would see it, and also both it and the constant form could use <code>llvm.dbg.value</code></p>



<a name="187620576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187620576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187620576">(Feb 07 2020 at 08:07)</a>:</h4>
<p>the goal is to reduce the impact of debuginfo on optimizations and codegen</p>



<a name="187620632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187620632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187620632">(Feb 07 2020 at 08:08)</a>:</h4>
<p>but maybe I should do some statistics on the kinds of things that are e.g. unnecessarily on the stack in debug mode</p>



<a name="187629010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187629010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187629010">(Feb 07 2020 at 10:46)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> By "constant folder" do you mean const-prop or something else?</p>



<a name="187681078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681078">(Feb 07 2020 at 21:18)</a>:</h4>
<p>yeah I guess it's called const-prop</p>



<a name="187681256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681256">(Feb 07 2020 at 21:19)</a>:</h4>
<p>I'd argue propagation is just replacing uses with the value at the definition, whereas folding is e.g. <code>_5 = 1 + 2</code> =&gt; <code>_5 = 3</code> (there's no propagation there)</p>



<a name="187681268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681268">(Feb 07 2020 at 21:19)</a>:</h4>
<p>the current pass is a combination of propagation and folding</p>



<a name="187681623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681623">(Feb 07 2020 at 21:23)</a>:</h4>
<p>Sure yeah</p>



<a name="187681626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681626">(Feb 07 2020 at 21:23)</a>:</h4>
<p>I can't imagine it would be expensive</p>



<a name="187681686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681686">(Feb 07 2020 at 21:24)</a>:</h4>
<p>We've already done that check and know what locals satisfy that constraint</p>



<a name="187681831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681831">(Feb 07 2020 at 21:26)</a>:</h4>
<p>oh right you're not relying on dataflow?</p>



<a name="187681840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187681840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187681840">(Feb 07 2020 at 21:26)</a>:</h4>
<p>I guess you couldn't have, <span class="user-mention" data-user-id="118594">@ecstatic-morse</span>'s stuff is pretty recent</p>



<a name="187682124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/187682124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#187682124">(Feb 07 2020 at 21:30)</a>:</h4>
<p>Nah, not yet</p>



<a name="199613497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199613497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199613497">(Jun 03 2020 at 12:38)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>  I took a stab at implementing this. Does this seem about right to you? <a href="https://github.com/rust-lang/rust/compare/master...wesleywiser:consts_in_debuginfo">https://github.com/rust-lang/rust/compare/master...wesleywiser:consts_in_debuginfo</a></p>



<a name="199624398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199624398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199624398">(Jun 03 2020 at 14:13)</a>:</h4>
<p>quick side note just from looking at the tests: use <code>Display</code> formatting for the constant instead of <code>Debug</code> formatting</p>



<a name="199624530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199624530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199624530">(Jun 03 2020 at 14:14)</a>:</h4>
<p>Thanks! Will do</p>



<a name="199745232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199745232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199745232">(Jun 04 2020 at 13:21)</a>:</h4>
<p>Yeah, that's way better:</p>
<div class="codehilite"><pre><span></span><code><span class="gd">-         debug x =&gt; _1;                   // in scope 1 at $DIR/scalar_literal_propagation.rs:3:9: 3:10</span>
<span class="gi">+         debug x =&gt; const 1u32;           // in scope 1 at $DIR/scalar_literal_propagation.rs:3:9: 3:10</span>
</code></pre></div>



<a name="199761539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199761539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199761539">(Jun 04 2020 at 15:12)</a>:</h4>
<p>I wouldn't change <code>VariableKind</code></p>



<a name="199761632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199761632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199761632">(Jun 04 2020 at 15:13)</a>:</h4>
<p>it refers to the LHS not the RHS even if it's computed from the RHS.... it's kind of messed up</p>



<a name="199761693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199761693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199761693">(Jun 04 2020 at 15:13)</a>:</h4>
<p>changing <code>PerLocalVarDebugInfo</code> also doesn't seem necessary</p>



<a name="199761759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199761759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199761759">(Jun 04 2020 at 15:14)</a>:</h4>
<p>Ah yeah I think I only matched against it here so that's not necessary <a href="https://github.com/rust-lang/rust/compare/master...wesleywiser:consts_in_debuginfo#diff-59edf51044167945d3d123c17e706bfdR544">https://github.com/rust-lang/rust/compare/master...wesleywiser:consts_in_debuginfo#diff-59edf51044167945d3d123c17e706bfdR544</a></p>



<a name="199762011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762011">(Jun 04 2020 at 15:15)</a>:</h4>
<p>so hmm starting from the MIR</p>



<a name="199762056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762056">(Jun 04 2020 at 15:15)</a>:</h4>
<p>I wouldn't split the <code>DebugInfo</code> in <code>VarDebugInfo</code></p>



<a name="199762159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762159">(Jun 04 2020 at 15:16)</a>:</h4>
<p>so <code>VarDebugInfoValue</code>, although it doesn't feel great either. I wonder what I used in the SROA PR</p>



<a name="199762248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762248">(Jun 04 2020 at 15:16)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> <code>VarDebugInfoContents</code></p>



<a name="199762334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762334">(Jun 04 2020 at 15:17)</a>:</h4>
<p>Is that in your SROA PR?</p>



<a name="199762347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762347">(Jun 04 2020 at 15:17)</a>:</h4>
<p>yeah</p>



<a name="199762416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762416">(Jun 04 2020 at 15:17)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/48300">#48300</a> right?</p>



<a name="199762426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762426">(Jun 04 2020 at 15:17)</a>:</h4>
<p>there it's used for simple leaves vs composite (each field has its own <code>VarDebugInfoContents</code>)</p>



<a name="199762444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762444">(Jun 04 2020 at 15:18)</a>:</h4>
<p>yeah</p>



<a name="199762814"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762814" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762814">(Jun 04 2020 at 15:20)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> so, the reason changing <code>PerLocalVarDebugInfo</code> doesn't make sense to me is that it's specifically the information you need to emit debuginfo <em>for initializing a given <code>Local</code></em></p>



<a name="199762878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762878">(Jun 04 2020 at 15:20)</a>:</h4>
<p>if it's a constant there's no local involved</p>



<a name="199762889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762889">(Jun 04 2020 at 15:20)</a>:</h4>
<p>Yeah</p>



<a name="199762944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762944">(Jun 04 2020 at 15:21)</a>:</h4>
<p>The reason I did that was I needed all the same fields except <code>projection</code></p>



<a name="199762984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762984">(Jun 04 2020 at 15:21)</a>:</h4>
<p>you don't need to gather them into a <code>Vec</code> tho</p>



<a name="199762988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199762988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199762988">(Jun 04 2020 at 15:21)</a>:</h4>
<p>Which is not a great reason to hack it in there lol</p>



<a name="199763201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763201">(Jun 04 2020 at 15:22)</a>:</h4>
<p>you don't need "var name" for constants</p>



<a name="199763239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763239">(Jun 04 2020 at 15:23)</a>:</h4>
<p>since they can't have it anyway (only fn args and instructions can have names)</p>



<a name="199763411"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763411" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763411">(Jun 04 2020 at 15:24)</a>:</h4>
<p>so you should just get away with spill  + <code>dbg_var_addr</code></p>



<a name="199763635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763635">(Jun 04 2020 at 15:25)</a>:</h4>
<p>oh I see, you're triggering it from <code>debug_introduce_locals</code></p>



<a name="199763777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763777">(Jun 04 2020 at 15:26)</a>:</h4>
<p>Yeah</p>



<a name="199763804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763804">(Jun 04 2020 at 15:26)</a>:</h4>
<p>okay so uhhh my advice to keep this simple likely requires renaming <code>compute_per_local_var_debug_info</code></p>



<a name="199763857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763857">(Jun 04 2020 at 15:27)</a>:</h4>
<p>I did it that way because the current system seems pretty oriented around locals which we've removed for constants.</p>



<a name="199763882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763882">(Jun 04 2020 at 15:27)</a>:</h4>
<p>and instead of <code>per_local[place.local].push(</code> it can do <code>dbg_var_addr</code> directly</p>



<a name="199763950"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763950" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763950">(Jun 04 2020 at 15:27)</a>:</h4>
<p>well it's oriented around locals in a very specific way that makes no sense for constants</p>



<a name="199763967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199763967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199763967">(Jun 04 2020 at 15:28)</a>:</h4>
<p>Yeah</p>



<a name="199764007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764007">(Jun 04 2020 at 15:28)</a>:</h4>
<p>specifically it's <em>on-demand</em> for locals</p>



<a name="199764016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764016">(Jun 04 2020 at 15:28)</a>:</h4>
<p>or on-assignment rather</p>



<a name="199764042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764042">(Jun 04 2020 at 15:28)</a>:</h4>
<p>Ok, I think I'm following that.</p>



<a name="199764052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764052">(Jun 04 2020 at 15:28)</a>:</h4>
<p>no need to do that kind of deferral for constants</p>



<a name="199764089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764089">(Jun 04 2020 at 15:28)</a>:</h4>
<p>And yeah if we do it that way I don't need to collect to a vec or modify PerLocalDebugInfo</p>



<a name="199764115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764115">(Jun 04 2020 at 15:29)</a>:</h4>
<p>mhmm</p>



<a name="199764125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764125">(Jun 04 2020 at 15:29)</a>:</h4>
<p>thanks for pointing me to this btw</p>



<a name="199764131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764131">(Jun 04 2020 at 15:29)</a>:</h4>
<p>Thanks, that's really helpful!</p>



<a name="199764149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764149">(Jun 04 2020 at 15:29)</a>:</h4>
<p>as you may have noticed I've been kind of out of it</p>



<a name="199764158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764158">(Jun 04 2020 at 15:29)</a>:</h4>
<p>where "it" is everything</p>



<a name="199764159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764159">(Jun 04 2020 at 15:29)</a>:</h4>
<p>np!</p>



<a name="199764197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764197">(Jun 04 2020 at 15:29)</a>:</h4>
<p>I knew you'd probably be interested <span aria-label="slight smile" class="emoji emoji-1f642" role="img" title="slight smile">:slight_smile:</span></p>



<a name="199764331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764331">(Jun 04 2020 at 15:30)</a>:</h4>
<p>Re the SROA changes. Do you still think I should try to incorporate those into this?</p>



<a name="199764563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764563">(Jun 04 2020 at 15:31)</a>:</h4>
<p>just the name :P</p>



<a name="199764614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764614">(Jun 04 2020 at 15:32)</a>:</h4>
<p>i.e. value -&gt; contents</p>



<a name="199764631"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764631" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764631">(Jun 04 2020 at 15:32)</a>:</h4>
<p>only if you think it makes sense</p>



<a name="199764637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764637">(Jun 04 2020 at 15:32)</a>:</h4>
<p>Ah ok</p>



<a name="199764647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764647">(Jun 04 2020 at 15:32)</a>:</h4>
<p>I forget exactly what my line of reasoning was</p>



<a name="199764657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764657">(Jun 04 2020 at 15:32)</a>:</h4>
<p>That's totally fine</p>



<a name="199764700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764700">(Jun 04 2020 at 15:32)</a>:</h4>
<p>I have no strong opinions here lol</p>



<a name="199764953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo%20using%20constants%20instead%20of%20locals/near/199764953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/VarDebugInfo.20using.20constants.20instead.20of.20locals.html#199764953">(Jun 04 2020 at 15:34)</a>:</h4>
<p>Thanks for taking a look at this! I really appreciate it</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>